<?php

function check_active_sidebar_menu($current_menu)
{		
	/**
	 * Add your menu URL to array below
	 * dont forget call this function on sidebar.blade.php	 
	 */
	$menu_map = array(
		'dashboard'                => 'dashboard',
		'users'                    => 'master',		
		'users/*'                  => 'master',		
		'tipes'                    => 'master',		
		'tipes/*'                  => 'master',		
		'agamas'                   => 'master',		
		'agamas/*'                 => 'master',		
		'provinsis'                => 'master',		
		'provinsis/*'              => 'master',		
		'kabupatens'               => 'master',		
		'kabupatens/*'             => 'master',		
		'kecamatans'               => 'master',		
		'kecamatans/*'             => 'master',		
		'kelurahans'               => 'master',		
		'kelurahans/*'             => 'master',		
		'detail_kipems'            => 'master',		
		'detail_kipems/*'          => 'master',		
		'status_keluargas'         => 'master',		
		'status_keluargas/*'       => 'master',		
		'pendidikans'              => 'master',		
		'pendidikans/*'            => 'master',		
		'status_penghasilans'      => 'master',		
		'status_penghasilans/*'    => 'master',		
		'jenis_pekerjaans'         => 'master',	
		'jenis_pekerjaans/*'       => 'master',	
		'kipem/notif'              => 'notif',	
		'kipem/notif/*'            => 'notif',	
		'lokasis'                  =>'lokasi',
		'lokasis/*'                =>'lokasi',
		'penduduks'                =>'penduduk',
		'penduduks/*'              =>'penduduk',
		'penduduk/*'               =>'penduduk',
		'tamus'                    =>'tamu',
		'tamus/*'                  =>'tamu',
		'tamu/*'                   =>'tamu',
		'kipems'                   =>'kipem',
		'kipems/*'                 =>'kipem',		
		'kipem/filter'             =>'kipem',		
		'kipem/check_perpanjangan' =>'kipem',		
		'kipem/proses'             =>'kipem',		
		'kipem/check'              =>'kipem',		
		'kipem/create'             =>'kipem',		
		'stlds'                    =>'stld',
		'stlds/*'                  =>'stld',
		'stld/*'                   =>'stld',
		'laporan/*'                =>'laporan',
		'pengaturan/*'             =>'pengaturan',
	);

	foreach ($menu_map as $key => $value) {				
		if(Request::is($key) && ($current_menu == $value)) {
			return "active";
		}
	}
	return "";	
}

function umur($ttl) {
	$ttl_array = explode('-', $ttl);
	$tahun_lahir = $ttl_array[0];
	return date("Y") - $tahun_lahir;
}

?>